import styles from './index.less';
import { Radio, Tooltip } from 'antd';
import React from 'react';

export const columns = [
  {
    code: 'time',
    name: '时间段',
    align: 'center',
    width: 120,
  },
  {
    code: 'dataSourceName',
    name: (
      <div className={styles.dataSourceId}>
        <div className={styles.ratio}>调整比例(%)</div>
        <div className={styles.predictSource}>基准预测源</div>
        <div className={styles.maxNum}>最大值</div>
        <div className={styles.minNum}>最小值</div>
      </div>
    ),
    width: 295,
    render(v, record) {
      return (
        <div className={styles.dataSourceIdShow}>
          <div className={styles.radio}>
            <Radio checked={record?.useType === 'dataSource'} disabled />
          </div>
          <div className={styles.ratio}>{record?.rateValue ?? 100}</div>
          <div className={styles.predictSource}>
            <Tooltip placement="topLeft" title={v}>
              {v}
            </Tooltip>
          </div>
          <div className={styles.maxNum}>{record?.max ?? '0.000'}</div>
          <div className={styles.minNum}>{record?.min ?? '0.000'}</div>
        </div>
      );
    },
  },
  {
    code: 'fixedValue',
    name: (
      <div className={styles.fixedValue}>
        <div className={styles.radio}>{''}</div>
        <div className={styles.name}>固定值</div>
      </div>
    ),
    width: 100,
    render(v, record) {
      return (
        <div className={styles.fixedValueShow}>
          <div className={styles.radio}>
            <Radio checked={record?.useType === 'fixation'} disabled />
          </div>
          <div className={styles.fixedValueShowInput}>{record?.fixation ?? '0.000'}</div>
        </div>
      );
    },
  },
];
